import os
from python_pdf_merge import PDFMergeConfig, merge_pdfs

if not os.path.exists("./output"):
    os.mkdir("output")

cfg = PDFMergeConfig(
    folders=[r"assets/files"],
    output_pdf="output/merged-papers.pdf",
    insert_blank_page=False,
    sort_func=[
        lambda name: name,
    ],
    label_formatter=[lambda name: name.split("：", 1)[1]], # 按中文冒号进行分割
    catalog_font_file="assets/SIMSUN.ttf",
)
merge_pdfs(cfg)
